package com.twu.biblioteca;

public class BooksReserveController implements Option {

    @Override
    public String getServiceDescription() {
        return "Reserve a book";
    }

    @Override
    public String supplyService() {
        LoginController loginController = new LoginController();
        if (loginController.checkLogin()) {
            System.out.println("Please input the BookID:");
            String bookId = BibliotecaApp.getUserInput();
            return BibliotecaApp.getBookcase().reserveBook(bookId);
        }else {
            System.out.println("Please Login System!");
            System.out.print("Id: ");
            String id = BibliotecaApp.getUserInput();
            System.out.print("Password: ");
            String password = BibliotecaApp.getUserInput();
            loginController.Login(id, password);
            return "";
        }
    }
}
